//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS CloudHSM service.
///
/// AWS CloudHSM Service This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
public struct CloudHSM: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the CloudHSM client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            amzTarget: "CloudHsmFrontendService",
            serviceName: "CloudHSM",
            serviceIdentifier: "cloudhsm",
            serviceProtocol: .json(version: "1.1"),
            apiVersion: "2014-05-30",
            endpoint: endpoint,
            errorType: CloudHSMErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Adds or overwrites one or more tags for the specified AWS CloudHSM resource. Each tag consists of a key and a value. Tag keys must be unique to each resource.
    @available(*, deprecated, message: "This API is deprecated.")
    @Sendable
    @inlinable
    public func addTagsToResource(_ input: AddTagsToResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> AddTagsToResourceResponse {
        try await self.client.execute(
            operation: "AddTagsToResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Adds or overwrites one or more tags for the specified AWS CloudHSM resource. Each tag consists of a key and a value. Tag keys must be unique to each resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the AWS CloudHSM resource to tag.
    ///   - tagList: One or more tags.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This API is deprecated.")
    @inlinable
    public func addTagsToResource(
        resourceArn: String,
        tagList: [Tag],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> AddTagsToResourceResponse {
        let input = AddTagsToResourceRequest(
            resourceArn: resourceArn, 
            tagList: tagList
        )
        return try await self.addTagsToResource(input, logger: logger)
    }

    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Creates a high-availability partition group. A high-availability partition group is a group of partitions that spans multiple physical HSMs.
    @available(*, deprecated, message: "This API is deprecated.")
    @Sendable
    @inlinable
    public func createHapg(_ input: CreateHapgRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateHapgResponse {
        try await self.client.execute(
            operation: "CreateHapg", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Creates a high-availability partition group. A high-availability partition group is a group of partitions that spans multiple physical HSMs.
    ///
    /// Parameters:
    ///   - label: The label of the new high-availability partition group.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This API is deprecated.")
    @inlinable
    public func createHapg(
        label: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateHapgResponse {
        let input = CreateHapgRequest(
            label: label
        )
        return try await self.createHapg(input, logger: logger)
    }

    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Creates an uninitialized HSM instance. There is an upfront fee charged for each HSM instance that you create with the CreateHsm operation. If you accidentally provision an HSM and want to request a refund, delete the instance using the DeleteHsm operation, go to the AWS Support Center, create a new case, and select Account and Billing Support.  It can take up to 20 minutes to create and provision an HSM. You can monitor the status of the HSM with the DescribeHsm operation. The HSM is ready to be initialized when the status changes to RUNNING.
    @available(*, deprecated, message: "This API is deprecated.")
    @Sendable
    @inlinable
    public func createHsm(_ input: CreateHsmRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateHsmResponse {
        try await self.client.execute(
            operation: "CreateHsm", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Creates an uninitialized HSM instance. There is an upfront fee charged for each HSM instance that you create with the CreateHsm operation. If you accidentally provision an HSM and want to request a refund, delete the instance using the DeleteHsm operation, go to the AWS Support Center, create a new case, and select Account and Billing Support.  It can take up to 20 minutes to create and provision an HSM. You can monitor the status of the HSM with the DescribeHsm operation. The HSM is ready to be initialized when the status changes to RUNNING.
    ///
    /// Parameters:
    ///   - clientToken: A user-defined token to ensure idempotence. Subsequent calls to this operation with the same token will be ignored.
    ///   - eniIp: The IP address to assign to the HSM's ENI. If an IP address is not specified, an IP address will be randomly chosen from the CIDR range of the subnet.
    ///   - externalId: The external ID from IamRoleArn, if present.
    ///   - iamRoleArn: The ARN of an IAM role to enable the AWS CloudHSM service to allocate an ENI on your behalf.
    ///   - sshKey: The SSH public key to install on the HSM.
    ///   - subnetId: The identifier of the subnet in your VPC in which to place the HSM.
    ///   - subscriptionType: 
    ///   - syslogIp: The IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This API is deprecated.")
    @inlinable
    public func createHsm(
        clientToken: String? = nil,
        eniIp: String? = nil,
        externalId: String? = nil,
        iamRoleArn: String,
        sshKey: String,
        subnetId: String,
        subscriptionType: SubscriptionType,
        syslogIp: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateHsmResponse {
        let input = CreateHsmRequest(
            clientToken: clientToken, 
            eniIp: eniIp, 
            externalId: externalId, 
            iamRoleArn: iamRoleArn, 
            sshKey: sshKey, 
            subnetId: subnetId, 
            subscriptionType: subscriptionType, 
            syslogIp: syslogIp
        )
        return try await self.createHsm(input, logger: logger)
    }

    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Creates an HSM client.
    @available(*, deprecated, message: "This API is deprecated.")
    @Sendable
    @inlinable
    public func createLunaClient(_ input: CreateLunaClientRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateLunaClientResponse {
        try await self.client.execute(
            operation: "CreateLunaClient", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Creates an HSM client.
    ///
    /// Parameters:
    ///   - certificate: The contents of a Base64-Encoded X.509 v3 certificate to be installed on the HSMs used by this client.
    ///   - label: The label for the client.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This API is deprecated.")
    @inlinable
    public func createLunaClient(
        certificate: String,
        label: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateLunaClientResponse {
        let input = CreateLunaClientRequest(
            certificate: certificate, 
            label: label
        )
        return try await self.createLunaClient(input, logger: logger)
    }

    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Deletes a high-availability partition group.
    @available(*, deprecated, message: "This API is deprecated.")
    @Sendable
    @inlinable
    public func deleteHapg(_ input: DeleteHapgRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteHapgResponse {
        try await self.client.execute(
            operation: "DeleteHapg", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Deletes a high-availability partition group.
    ///
    /// Parameters:
    ///   - hapgArn: The ARN of the high-availability partition group to delete.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This API is deprecated.")
    @inlinable
    public func deleteHapg(
        hapgArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteHapgResponse {
        let input = DeleteHapgRequest(
            hapgArn: hapgArn
        )
        return try await self.deleteHapg(input, logger: logger)
    }

    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Deletes an HSM. After completion, this operation cannot be undone and your key material cannot be recovered.
    @available(*, deprecated, message: "This API is deprecated.")
    @Sendable
    @inlinable
    public func deleteHsm(_ input: DeleteHsmRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteHsmResponse {
        try await self.client.execute(
            operation: "DeleteHsm", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Deletes an HSM. After completion, this operation cannot be undone and your key material cannot be recovered.
    ///
    /// Parameters:
    ///   - hsmArn: The ARN of the HSM to delete.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This API is deprecated.")
    @inlinable
    public func deleteHsm(
        hsmArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteHsmResponse {
        let input = DeleteHsmRequest(
            hsmArn: hsmArn
        )
        return try await self.deleteHsm(input, logger: logger)
    }

    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Deletes a client.
    @available(*, deprecated, message: "This API is deprecated.")
    @Sendable
    @inlinable
    public func deleteLunaClient(_ input: DeleteLunaClientRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteLunaClientResponse {
        try await self.client.execute(
            operation: "DeleteLunaClient", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Deletes a client.
    ///
    /// Parameters:
    ///   - clientArn: The ARN of the client to delete.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This API is deprecated.")
    @inlinable
    public func deleteLunaClient(
        clientArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteLunaClientResponse {
        let input = DeleteLunaClientRequest(
            clientArn: clientArn
        )
        return try await self.deleteLunaClient(input, logger: logger)
    }

    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Retrieves information about a high-availability partition group.
    @available(*, deprecated, message: "This API is deprecated.")
    @Sendable
    @inlinable
    public func describeHapg(_ input: DescribeHapgRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeHapgResponse {
        try await self.client.execute(
            operation: "DescribeHapg", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Retrieves information about a high-availability partition group.
    ///
    /// Parameters:
    ///   - hapgArn: The ARN of the high-availability partition group to describe.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This API is deprecated.")
    @inlinable
    public func describeHapg(
        hapgArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeHapgResponse {
        let input = DescribeHapgRequest(
            hapgArn: hapgArn
        )
        return try await self.describeHapg(input, logger: logger)
    }

    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Retrieves information about an HSM. You can identify the HSM by its ARN or its serial number.
    @available(*, deprecated, message: "This API is deprecated.")
    @Sendable
    @inlinable
    public func describeHsm(_ input: DescribeHsmRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeHsmResponse {
        try await self.client.execute(
            operation: "DescribeHsm", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Retrieves information about an HSM. You can identify the HSM by its ARN or its serial number.
    ///
    /// Parameters:
    ///   - hsmArn: The ARN of the HSM. Either the HsmArn or the SerialNumber parameter must be specified.
    ///   - hsmSerialNumber: The serial number of the HSM. Either the HsmArn or the HsmSerialNumber parameter must be specified.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This API is deprecated.")
    @inlinable
    public func describeHsm(
        hsmArn: String? = nil,
        hsmSerialNumber: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeHsmResponse {
        let input = DescribeHsmRequest(
            hsmArn: hsmArn, 
            hsmSerialNumber: hsmSerialNumber
        )
        return try await self.describeHsm(input, logger: logger)
    }

    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Retrieves information about an HSM client.
    @available(*, deprecated, message: "This API is deprecated.")
    @Sendable
    @inlinable
    public func describeLunaClient(_ input: DescribeLunaClientRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeLunaClientResponse {
        try await self.client.execute(
            operation: "DescribeLunaClient", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Retrieves information about an HSM client.
    ///
    /// Parameters:
    ///   - certificateFingerprint: The certificate fingerprint.
    ///   - clientArn: The ARN of the client.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This API is deprecated.")
    @inlinable
    public func describeLunaClient(
        certificateFingerprint: String? = nil,
        clientArn: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeLunaClientResponse {
        let input = DescribeLunaClientRequest(
            certificateFingerprint: certificateFingerprint, 
            clientArn: clientArn
        )
        return try await self.describeLunaClient(input, logger: logger)
    }

    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Gets the configuration files necessary to connect to all high availability partition groups the client is associated with.
    @available(*, deprecated, message: "This API is deprecated.")
    @Sendable
    @inlinable
    public func getConfig(_ input: GetConfigRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetConfigResponse {
        try await self.client.execute(
            operation: "GetConfig", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Gets the configuration files necessary to connect to all high availability partition groups the client is associated with.
    ///
    /// Parameters:
    ///   - clientArn: The ARN of the client.
    ///   - clientVersion: The client version.
    ///   - hapgList: A list of ARNs that identify the high-availability partition groups that are associated with the client.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This API is deprecated.")
    @inlinable
    public func getConfig(
        clientArn: String,
        clientVersion: ClientVersion,
        hapgList: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetConfigResponse {
        let input = GetConfigRequest(
            clientArn: clientArn, 
            clientVersion: clientVersion, 
            hapgList: hapgList
        )
        return try await self.getConfig(input, logger: logger)
    }

    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Lists the Availability Zones that have available AWS CloudHSM capacity.
    @available(*, deprecated, message: "This API is deprecated.")
    @Sendable
    @inlinable
    public func listAvailableZones(_ input: ListAvailableZonesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListAvailableZonesResponse {
        try await self.client.execute(
            operation: "ListAvailableZones", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Lists the Availability Zones that have available AWS CloudHSM capacity.
    ///
    /// Parameters:
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This API is deprecated.")
    @inlinable
    public func listAvailableZones(
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListAvailableZonesResponse {
        let input = ListAvailableZonesRequest(
        )
        return try await self.listAvailableZones(input, logger: logger)
    }

    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Lists the high-availability partition groups for the account. This operation supports pagination with the use of the NextToken member. If more results are available, the NextToken member of the response contains a token that you pass in the next call to ListHapgs to retrieve the next set of items.
    @available(*, deprecated, message: "This API is deprecated.")
    @Sendable
    @inlinable
    public func listHapgs(_ input: ListHapgsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListHapgsResponse {
        try await self.client.execute(
            operation: "ListHapgs", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Lists the high-availability partition groups for the account. This operation supports pagination with the use of the NextToken member. If more results are available, the NextToken member of the response contains a token that you pass in the next call to ListHapgs to retrieve the next set of items.
    ///
    /// Parameters:
    ///   - nextToken: The NextToken value from a previous call to ListHapgs. Pass null if this is the first call.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This API is deprecated.")
    @inlinable
    public func listHapgs(
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListHapgsResponse {
        let input = ListHapgsRequest(
            nextToken: nextToken
        )
        return try await self.listHapgs(input, logger: logger)
    }

    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Retrieves the identifiers of all of the HSMs provisioned for the current customer. This operation supports pagination with the use of the NextToken member. If more results are available, the NextToken member of the response contains a token that you pass in the next call to ListHsms to retrieve the next set of items.
    @available(*, deprecated, message: "This API is deprecated.")
    @Sendable
    @inlinable
    public func listHsms(_ input: ListHsmsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListHsmsResponse {
        try await self.client.execute(
            operation: "ListHsms", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Retrieves the identifiers of all of the HSMs provisioned for the current customer. This operation supports pagination with the use of the NextToken member. If more results are available, the NextToken member of the response contains a token that you pass in the next call to ListHsms to retrieve the next set of items.
    ///
    /// Parameters:
    ///   - nextToken: The NextToken value from a previous call to ListHsms. Pass null if this is the first call.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This API is deprecated.")
    @inlinable
    public func listHsms(
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListHsmsResponse {
        let input = ListHsmsRequest(
            nextToken: nextToken
        )
        return try await self.listHsms(input, logger: logger)
    }

    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Lists all of the clients. This operation supports pagination with the use of the NextToken member. If more results are available, the NextToken member of the response contains a token that you pass in the next call to ListLunaClients to retrieve the next set of items.
    @available(*, deprecated, message: "This API is deprecated.")
    @Sendable
    @inlinable
    public func listLunaClients(_ input: ListLunaClientsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListLunaClientsResponse {
        try await self.client.execute(
            operation: "ListLunaClients", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Lists all of the clients. This operation supports pagination with the use of the NextToken member. If more results are available, the NextToken member of the response contains a token that you pass in the next call to ListLunaClients to retrieve the next set of items.
    ///
    /// Parameters:
    ///   - nextToken: The NextToken value from a previous call to ListLunaClients. Pass null if this is the first call.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This API is deprecated.")
    @inlinable
    public func listLunaClients(
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListLunaClientsResponse {
        let input = ListLunaClientsRequest(
            nextToken: nextToken
        )
        return try await self.listLunaClients(input, logger: logger)
    }

    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Returns a list of all tags for the specified AWS CloudHSM resource.
    @available(*, deprecated, message: "This API is deprecated.")
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Returns a list of all tags for the specified AWS CloudHSM resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the AWS CloudHSM resource.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This API is deprecated.")
    @inlinable
    public func listTagsForResource(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Modifies an existing high-availability partition group.
    @available(*, deprecated, message: "This API is deprecated.")
    @Sendable
    @inlinable
    public func modifyHapg(_ input: ModifyHapgRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ModifyHapgResponse {
        try await self.client.execute(
            operation: "ModifyHapg", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Modifies an existing high-availability partition group.
    ///
    /// Parameters:
    ///   - hapgArn: The ARN of the high-availability partition group to modify.
    ///   - label: The new label for the high-availability partition group.
    ///   - partitionSerialList: The list of partition serial numbers to make members of the high-availability partition group.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This API is deprecated.")
    @inlinable
    public func modifyHapg(
        hapgArn: String,
        label: String? = nil,
        partitionSerialList: [String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ModifyHapgResponse {
        let input = ModifyHapgRequest(
            hapgArn: hapgArn, 
            label: label, 
            partitionSerialList: partitionSerialList
        )
        return try await self.modifyHapg(input, logger: logger)
    }

    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Modifies an HSM.  This operation can result in the HSM being offline for up to 15 minutes while the AWS CloudHSM service is reconfigured. If you are modifying a production HSM, you should ensure that your AWS CloudHSM service is configured for high availability, and consider executing this operation during a maintenance window.
    @available(*, deprecated, message: "This API is deprecated.")
    @Sendable
    @inlinable
    public func modifyHsm(_ input: ModifyHsmRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ModifyHsmResponse {
        try await self.client.execute(
            operation: "ModifyHsm", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Modifies an HSM.  This operation can result in the HSM being offline for up to 15 minutes while the AWS CloudHSM service is reconfigured. If you are modifying a production HSM, you should ensure that your AWS CloudHSM service is configured for high availability, and consider executing this operation during a maintenance window.
    ///
    /// Parameters:
    ///   - eniIp: The new IP address for the elastic network interface (ENI) attached to the HSM. If the HSM is moved to a different subnet, and an IP address is not specified, an IP address will be randomly chosen from the CIDR range of the new subnet.
    ///   - externalId: The new external ID.
    ///   - hsmArn: The ARN of the HSM to modify.
    ///   - iamRoleArn: The new IAM role ARN.
    ///   - subnetId: The new identifier of the subnet that the HSM is in. The new subnet must be in the same Availability Zone as the current subnet.
    ///   - syslogIp: The new IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This API is deprecated.")
    @inlinable
    public func modifyHsm(
        eniIp: String? = nil,
        externalId: String? = nil,
        hsmArn: String,
        iamRoleArn: String? = nil,
        subnetId: String? = nil,
        syslogIp: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ModifyHsmResponse {
        let input = ModifyHsmRequest(
            eniIp: eniIp, 
            externalId: externalId, 
            hsmArn: hsmArn, 
            iamRoleArn: iamRoleArn, 
            subnetId: subnetId, 
            syslogIp: syslogIp
        )
        return try await self.modifyHsm(input, logger: logger)
    }

    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Modifies the certificate used by the client. This action can potentially start a workflow to install the new certificate on the client's HSMs.
    @available(*, deprecated, message: "This API is deprecated.")
    @Sendable
    @inlinable
    public func modifyLunaClient(_ input: ModifyLunaClientRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ModifyLunaClientResponse {
        try await self.client.execute(
            operation: "ModifyLunaClient", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Modifies the certificate used by the client. This action can potentially start a workflow to install the new certificate on the client's HSMs.
    ///
    /// Parameters:
    ///   - certificate: The new certificate for the client.
    ///   - clientArn: The ARN of the client.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This API is deprecated.")
    @inlinable
    public func modifyLunaClient(
        certificate: String,
        clientArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ModifyLunaClientResponse {
        let input = ModifyLunaClientRequest(
            certificate: certificate, 
            clientArn: clientArn
        )
        return try await self.modifyLunaClient(input, logger: logger)
    }

    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Removes one or more tags from the specified AWS CloudHSM resource. To remove a tag, specify only the tag key to remove (not the value). To overwrite the value for an existing tag, use AddTagsToResource.
    @available(*, deprecated, message: "This API is deprecated.")
    @Sendable
    @inlinable
    public func removeTagsFromResource(_ input: RemoveTagsFromResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> RemoveTagsFromResourceResponse {
        try await self.client.execute(
            operation: "RemoveTagsFromResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.  For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference. Removes one or more tags from the specified AWS CloudHSM resource. To remove a tag, specify only the tag key to remove (not the value). To overwrite the value for an existing tag, use AddTagsToResource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the AWS CloudHSM resource.
    ///   - tagKeyList: The tag key or keys to remove. Specify only the tag key to remove (not the value). To overwrite the value for an existing tag, use AddTagsToResource.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This API is deprecated.")
    @inlinable
    public func removeTagsFromResource(
        resourceArn: String,
        tagKeyList: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> RemoveTagsFromResourceResponse {
        let input = RemoveTagsFromResourceRequest(
            resourceArn: resourceArn, 
            tagKeyList: tagKeyList
        )
        return try await self.removeTagsFromResource(input, logger: logger)
    }
}

extension CloudHSM {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: CloudHSM, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}
